#include "playmodelbutton.h"

PlayModelButton::PlayModelButton(QWidget *parent) :
    QPushButton(parent)
{
}
PlayListBaseModel::QUEUE_TYPE PlayModelButton::queueType() const
{
    return _queueType;
}

void PlayModelButton::setQueueType(const PlayListBaseModel::QUEUE_TYPE &queueType)
{
    if(queueType == _queueType){
        return;
    }
    _queueType = queueType;

    QIcon icon;
    switch(_queueType){
    case PlayListBaseModel::QUEUE_TYPE_RandPlay:
        icon = QIcon(":/playBarimage/playModelRandom");
        break;
    case PlayListBaseModel::QUEUE_TYPE_RepeatList:
        icon = QIcon(":/playBarimage/playModelLoopAll");
        break;
    case PlayListBaseModel::QUEUE_TYPE_RepeatOne:
        icon = QIcon(":/playBarimage/playModelLoopOne");
        break;
    default:
        icon = QIcon(":/playBarimage/playModelSeriation");
        break;
    }

    this->setIcon(icon);

}

